Garbage collection candidate selection using block overwrite rate

ABSTRACT

A processing device in a memory system determines a rate at which an amount of valid data is decreasing on a first block of the memory device and determines whether the rate at which the amount of valid data is decreasing on the first block satisfies a threshold criterion. Responsive to the rate at which the amount of valid data is decreasing on the first block satisfying the threshold criterion, the processing device performs a media management operation on the first block of the memory device.

RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/234,271, filed Dec. 27, 2018, the entire contents of which are herebyincorporated by reference herein.

TECHNICAL FIELD

Embodiments of the disclosure relate generally to memory sub-systems,and more specifically, relate to garbage collection candidate selectionusing block overwrite rate.

BACKGROUND

A memory sub-system can be a storage system, such as a solid-state drive(SSD), or a hard disk drive (HDD). A memory sub-system can be a memorymodule, such as a dual in-line memory module (DIMM), a small outlineDIMM (SO-DIMM), or a non-volatile dual in-line memory module (NVDIMM). Amemory sub-system can include one or more memory components that storedata. The memory components can be, for example, non-volatile memorycomponents and volatile memory components. In general, a host system canutilize a memory sub-system to store data at the memory components andto retrieve data from the memory components.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure will be understood more fully from the detaileddescription given below and from the accompanying drawings of variousembodiments of the disclosure.

FIG. 1 illustrates an example computing environment that includes amemory sub-system in accordance with some embodiments of the presentdisclosure.

FIG. 2 is a flow diagram of an example method to select blocks ascandidates for garbage collection using an overwrite rate for the blocksin accordance with some embodiments of the present disclosure.

FIGS. 3A-3C are graphs illustrating various overwrite rates for a datablock of a memory component in accordance with some embodiments of thepresent disclosure.

FIG. 4 is a flow diagram of an example method to reclaim space in amemory component in response to a write request in accordance with someembodiments of the present disclosure.

FIG. 5 is a block diagram of an example computer system in whichembodiments of the present disclosure may operate.

DETAILED DESCRIPTION

Aspects of the present disclosure are directed to tracking blockoverwrite rate for garbage collection candidate selection in a memorysub-system. A memory sub-system is also hereinafter referred to as a“memory device.” An example of a memory sub-system is a storage devicethat is coupled to a central processing unit (CPU) via a peripheralinterconnect (e.g., an input/output bus, a storage area network).Examples of storage devices include a solid-state drive (SSD), a flashdrive, a universal serial bus (USB) flash drive, and a hard disk drive(HDD). Another example of a memory sub-system is a memory module that iscoupled to the CPU via a memory bus. Examples of memory modules includea dual in-line memory module (DIMM), a small outline DIMM (SO-DIMM), anon-volatile dual in-line memory module (NVDIMM), etc. In someembodiments, the memory sub-system can be a hybrid memory/storagesub-system. In general, a host system can utilize a memory sub-systemthat includes one or more memory components. The host system can providedata to be stored at the memory sub-system and can request data to beretrieved from the memory sub-system.

A memory component in a memory sub-system can include memory cells thatcan include one or more memory pages (also referred to herein as“pages”) for storing one or more bits of binary data corresponding todata received from the host system. One or more memory pages of thememory component can be grouped together to form a data block. When datais written to the memory component, it is typically done at the pagelevel, such that an entire page, or multiple pages, is written in asingle operation. When the memory component is full, such that there isinsufficient capacity to accept additional write operations, certaindata can be erased in order to free up space. When data is erased fromthe memory component, however, it is typically done at the block level,such that an entire block (including multiple pages) is erased in asingle operation. Thus, when a particular segment of data on the memorycomponent is updated, for example, certain pages in a block will havedata that has been re-written to a different page and/or is no longerneeded. The entire block cannot simply be erased as each block likelyalso has some number of pages of valid data. A garbage collectionprocess can be performed which involves moving those pages of the blockthat contain valid data to another block, so that the current block canbe erased and rewritten. Garbage collection is a form of automaticmemory management that attempts to reclaim garbage, or memory occupiedby stale data objects that are no longer in use (e.g., because they havebeen updated with new values). The basic principle of garbage collectionis to find data objects that cannot or need not be accessed in thefuture, and to reclaim the resources (i.e. storage space) used by thoseobjects. The additional writes that result from moving data from oneblock to another during the garbage collection process create aphenomenon referred to as write amplification. This is generallyundesirable as the individual segments, data units, or blocks of thememory component can be written, read, and/or erased only a finitenumber of times before physical wear causes the memory component tofail.

A conventional memory sub-system identifies candidate blocks for garbagecollection based on the amount of valid data stored in each block. Thememory sub-system may maintain a record of how much valid data is storedin each block by incrementing or decrementing the record each time awrite or erase operation is performed. Conventional garbage collectionsolutions typically simply identify and erase the blocks on the memorycomponent that have the least amount of valid data at the time garbagecollection is performed. Other conventional solutions may usually exemptthe most recently written blocks from garbage collection, but stillidentify and erase those blocks with the least amount of valid data.Both of these techniques have certain inefficiencies, however. Blockswith already low amounts of valid data may continue to be updated in thefuture, resulting in even lower amounts of valid data that would need tobe rewritten if garbage collection was postponed for those blocks. Thus,garbage collecting those blocks before the additional data isinvalidated may result in unnecessary write amplification (i.e.,unnecessary wear on the memory component). Furthermore, by exempting themost recently written blocks from garbage collection (i.e., those blocksthat are likely to have lower levels of valid data since they arefrequently being updated), the conventional memory sub-system is likelygarbage collecting blocks with higher levels of valid data, resulting inadditional write amplification.

Aspects of the present disclosure address the above and otherdeficiencies by having a memory sub-system that identifies blocks ascandidates for garbage collection using an overwrite rate for theblocks. In one embodiment, the memory sub-system tracks a rate of changein the amount of valid data on recently written blocks of the memorycomponent to identify blocks for which the rate of data invalidation isgrowing (i.e., blocks for which the amount of valid data is continuingto decrease over time). In one embodiment, the percentage of valid (orinvalid) data in each block is logged periodically (e.g., after a periodof time has passed or after a certain amount of data has been written tothe memory component by the host). From these logs, the memorysub-system identifies a certain number of blocks on the memory componentthat have the least amount of valid data and, in one embodiment,determines whether those blocks were among the most recently writtenblocks. Blocks that were recently written to are likely to be written toagain in the future. These future writes include a chance that morepages in the block will be invalidated. Thus, if garbage collection forthose blocks that have been recently written is delayed, there is ahigher chance that more of that data will become invalidated over timeresulting is lesser write amplification.

In one embodiment, the memory sub-system computes a slope (i.e., therate of change of valid data over time) for each of those blocks thatare among the lowest amount of valid data and the most recently writtenfor use in selecting candidates for garbage collection. If the level ofvalid data on one of these blocks is trending downward, the memorysub-system can consider waiting to do garbage collection until later(i.e., the memory sub-system will not add that block to a list ofgarbage collection candidates). If the slope has leveled off and hasbeen consistent for a period of time (i.e., is saturated), then thecorresponding block can be a good current candidate for garbagecollection since further benefits are unlikely to be realized. As aresult, the memory sub-system might end up picking a block with higheramount of valid data now instead of one with lower valid data becausethat second block will likely have even less valid data in the future,leading to lower utilization of resources, including fewer program/erase(P/E) cycles and improved endurance for the memory component.

FIG. 1 illustrates an example computing environment 100 that includes amemory sub-system 110 in accordance with some embodiments of the presentdisclosure. The memory sub-system 110 can include media, such as memorycomponents 112A to 112N. The memory components 112A to 112N can bevolatile memory components, non-volatile memory components, or acombination of such. In some embodiments, the memory sub-system is astorage system. An example of a storage system is a SSD. In someembodiments, the memory sub-system 110 is a hybrid memory/storagesub-system. In general, the computing environment 100 can include a hostsystem 120 that uses the memory sub-system 110. For example, the hostsystem 120 can write data to the memory sub-system 110 and read datafrom the memory sub-system 110.

The host system 120 can be a computing device such as a desktopcomputer, laptop computer, network server, mobile device, or suchcomputing device that includes a memory and a processing device. Thehost system 120 can include or be coupled to the memory sub-system 110so that the host system 120 can read data from or write data to thememory sub-system 110. The host system 120 can be coupled to the memorysub-system 110 via a physical host interface. As used herein, “coupledto” generally refers to a connection between components, which can be anindirect communicative connection or direct communicative connection(e.g., without intervening components), whether wired or wireless,including connections such as electrical, optical, magnetic, etc.Examples of a physical host interface include, but are not limited to, aserial advanced technology attachment (SATA) interface, a peripheralcomponent interconnect express (PCIe) interface, universal serial bus(USB) interface, Fibre Channel, Serial Attached SCSI (SAS), etc. Thephysical host interface can be used to transmit data between the hostsystem 120 and the memory sub-system 110. The host system 120 canfurther utilize an NVM Express (NVMe) interface to access the memorycomponents 112A to 112N when the memory sub-system 110 is coupled withthe host system 120 by the PCIe interface. The physical host interfacecan provide an interface for passing control, address, data, and othersignals between the memory sub-system 110 and the host system 120.

The memory components 112A to 112N can include any combination of thedifferent types of non-volatile memory components and/or volatile memorycomponents. An example of non-volatile memory components includes anegative-and (NAND) type flash memory. Each of the memory components112A to 112N can include one or more arrays of memory cells such assingle level cells (SLCs) or multi-level cells (MLCs) (e.g., triplelevel cells (TLCs) or quad-level cells (QLCs)). In some embodiments, aparticular memory component can include both an SLC portion and a MLCportion of memory cells. Each of the memory cells can store one or morebits of data (e.g., data blocks) used by the host system 120. Althoughnon-volatile memory components such as NAND type flash memory aredescribed, the memory components 112A to 112N can be based on any othertype of memory such as a volatile memory. In some embodiments, thememory components 112A to 112N can be, but are not limited to, randomaccess memory (RAM), read-only memory (ROM), dynamic random accessmemory (DRAM), synchronous dynamic random access memory (SDRAM), phasechange memory (PCM), magneto random access memory (MRAM), negative-or(NOR) flash memory, electrically erasable programmable read-only memory(EEPROM), and a cross-point array of non-volatile memory cells. Across-point array of non-volatile memory can perform bit storage basedon a change of bulk resistance, in conjunction with a stackablecross-gridded data access array. Additionally, in contrast to manyflash-based memories, cross-point non-volatile memory can perform awrite in-place operation, where a non-volatile memory cell can beprogrammed without the non-volatile memory cell being previously erased.Furthermore, the memory cells of the memory components 112A to 112N canbe grouped as memory pages or data blocks that can refer to a unit ofthe memory component used to store data. The data blocks can be furthergrouped into one or more planes on each of memory components 112A to112N, where operations can be performed on each of the planesconcurrently. Corresponding data blocks from different planes can beassociated with one another in a stripe than spans across multipleplanes.

The memory system controller 115 (hereinafter referred to as“controller”) can communicate with the memory components 112A to 112N toperform operations such as reading data, writing data, or erasing dataat the memory components 112A to 112N and other such operations. Thecontroller 115 can include hardware such as one or more integratedcircuits and/or discrete components, a buffer memory, or a combinationthereof. The controller 115 can be a microcontroller, special purposelogic circuitry (e.g., a field programmable gate array (FPGA), anapplication specific integrated circuit (ASIC), etc.), or other suitableprocessor. The controller 115 can include a processor (processingdevice) 117 configured to execute instructions stored in local memory119. In the illustrated example, the local memory 119 of the controller115 includes an embedded memory configured to store instructions forperforming various processes, operations, logic flows, and routines thatcontrol operation of the memory sub-system 110, including handlingcommunications between the memory sub-system 110 and the host system120. In some embodiments, the local memory 119 can include memoryregisters storing memory pointers, fetched data, etc. The local memory119 can also include read-only memory (ROM) for storing micro-code.While the example memory sub-system 110 in FIG. 1 has been illustratedas including the controller 115, in another embodiment of the presentdisclosure, a memory sub-system 110 may not include a controller 115,and may instead rely upon external control (e.g., provided by anexternal host, or by a processor or controller separate from the memorysub-system).

In general, the controller 115 can receive commands or operations fromthe host system 120 and can convert the commands or operations intoinstructions or appropriate commands to achieve the desired access tothe memory components 112A to 112N. The controller 115 can beresponsible for other operations such as wear leveling operations,garbage collection operations, error detection and error-correcting code(ECC) operations, encryption operations, caching operations, and addresstranslations between a logical block address and a physical blockaddress that are associated with the memory components 112A to 112N. Thecontroller 115 can further include host interface circuitry tocommunicate with the host system 120 via the physical host interface.The host interface circuitry can convert the commands received from thehost system into command instructions to access the memory components112A to 112N as well as convert responses associated with the memorycomponents 112A to 112N into information for the host system 120.

The memory sub-system 110 can also include additional circuitry orcomponents that are not illustrated. In some embodiments, the memorysub-system 110 can include a cache or buffer (e.g., DRAM) and addresscircuitry (e.g., a row decoder and a column decoder) that can receive anaddress from the controller 115 and decode the address to access thememory components 112A to 112N.

The memory sub-system 110 includes a garbage collection component 113that can be used to select data blocks of memory components 112A to 112Nas candidates for garbage collection using an overwrite rate for theblocks. In one embodiment, the garbage collection process is initiatedperiodically as part of regular memory management operations for thememory sub-system 110. In another embodiment, the garbage collectionprocess is initiated in response to receiving a write request (e.g.,from host system 120) and a determination that memory components 112A to112N have insufficient capacity to accept the write request. In oneembodiment, garbage collection component 113 determines whether a firstdata block of a plurality of data blocks on one of memory components112A to 112N is among a first threshold number of the plurality of datablocks having a lower amount of valid data than a remainder of theplurality of data blocks. Responsive to the first data block being amongthe first threshold number, garbage collection component 113 determineswhether the first data block is among a second threshold number of theplurality of data blocks having been written to more recently than theremainder of the plurality of data blocks. Responsive to the first datablock being among the second threshold number, garbage collectioncomponent 113 determines whether a rate of change of an amount of validdata on the first data block is below a third threshold. Responsive tothe rate of change being below the third threshold, garbage collectioncomponent 113 identifies the first data block as a candidate for garbagecollection on the memory component. Further details with regards to theoperations of garbage collection component 113 are described below.

FIG. 2 is a flow diagram of an example method to select blocks ascandidates for garbage collection using an overwrite rate for the blocksin accordance with some embodiments of the present disclosure. Themethod 200 can be performed by processing logic that can includehardware (e.g., processing device, circuitry, dedicated logic,programmable logic, microcode, hardware of a device, integrated circuit,etc.), software (e.g., instructions run or executed on a processingdevice), or a combination thereof. In some embodiments, the method 200is performed by the garbage collection component 113 of FIG. 1. Althoughshown in a particular sequence or order, unless otherwise specified, theorder of the processes can be modified. Thus, the illustratedembodiments should be understood only as examples, and the illustratedprocesses can be performed in a different order, and some processes canbe performed in parallel. Additionally, one or more processes can beomitted in various embodiments. Thus, not all processes are required inevery embodiment. Other process flows are possible.

At operation 210, the processing device identifies a first data block ona memory component 112A. The data block may include a grouping of one ormore memory pages of the memory component 112A. In one embodiment, thedata block may be the smallest unit of the memory component 112A thatcan that be erased in a single operation and may be one of a pluralityof data blocks on memory component 112A. In one embodiment, garbagecollection component 113A performs the operations 210-280 for each ofthe plurality of data blocks on memory component 112A. For ease ofunderstanding, however, an embodiment is described herein using thefirst data block as an example, which may be any one of the plurality ofdata blocks on memory component 112A. In one embodiment, garbagecollection component 113 identifies some other data unit (e.g., a memorycell, a memory page, a super block, a plane, etc.) of memory component112A.

At operation 220, the processing device determines whether the firstdata block is among those data blocks on memory component 112A havingthe least amount of valid data. In one embodiment, garbage collectioncomponent 113 identifies an amount of valid data on each of theplurality of data blocks and sorts the plurality of data blocks based onthe amount of valid data on each of the plurality of data blocks. In oneembodiment, controller 115 maintains a record in local memory 119 of howmuch valid data is stored in each block of memory component 112A byincrementing or decrementing the record each time a write or eraseoperation is performed. Garbage collection component 113 can read theserecords for the data blocks and create a ranked list in local memory 119of the data blocks on memory component 112A from those having the mostamount of valid data to those having the least amount of valid data. Thevalid data may include data objects that are up to date and/or still inuse by host system 120. Conversely, the invalid data may include staledata objects that are no longer in use (e.g., because they have beenupdated with new values). In one embodiment, garbage collectioncomponent 113 determines whether the first data block satisfies a firstthreshold criterion pertaining to a first threshold number of theplurality of data blocks having a lower amount of valid data than aremainder of the plurality of data blocks. For example, the first numbermay include a number (e.g., 6, 8, 10, 15, 20, etc.) of data blocks fromthe ranked list having the lowest amount of valid data. In oneembodiment, garbage collection component 113 determines whether thefirst data block is among the first number of the plurality of datablocks. Although the embodiments described herein reference the amountof valid data in a data block, in other embodiments, garbage collectioncomponent 113 can determine the amount of invalid data and makedecisions using that value instead.

If the first data block is not among the first threshold number, atoperation 230, the processing device prevents the first data block frombeing identified as a candidate for garbage selection on the memorycomponent. If garbage collection component 113 determines that the firstdata block has too large of an amount of valid data, that data block isnot a good candidate for garbage collection because too much valid datamust be moved to another data block before the first data block can beerased, resulting in unnecessary wear on the memory component 112A.

If, however, the first data block is among the first threshold number,at operation 240, the processing device determines whether the firstdata bock is among those data blocks on memory component 112A that havebeen most recently written. In one embodiment, garbage collectioncomponent 113 determines when a write operation was performed on each ofthe plurality of data blocks and sorts the plurality of data blocksbased on the time that each respective write operation was performed.Garbage collection component 113 determines whether the first data blocksatisfies a second threshold condition pertaining to a second number ofthe plurality of data blocks having been written to more recently thanthe remainder of the plurality of data blocks. For example, the secondthreshold number may include a number (e.g., 6, 8, 10, 15, 20, etc.) ofdata blocks having been written most recently. In one embodiment, garagecollection component 113 identifies the second number of data blocksfrom all of the plurality of data blocks on memory component 112A anddetermines whether the first data block is among the second number ofdata blocks. In another embodiment, garage collection component 113identifies the second threshold number of data blocks from just the datablocks that are also among those having the least amount of dataidentified at operation 220. If the first data block is not among thesecond threshold number, at operation 280, the processing deviceidentifies the first data block as a candidate for garbage collection onthe memory component 112A, as will be described in more detail below.

If, however, the first data block is among the second threshold number,at operation 250, the processing device determines whether a rate ofchange of an amount of valid data on the first data block satisfies athird threshold criterion (i.e., is below a high threshold). The rate ofchange of the amount of valid data on the first data block represents alevel by which the amount of valid data on the first data block hasdecreased over a period of time. As illustrated in FIG. 3A, in oneembodiment, garbage collection component 113 determines the amount ofvalid data on the first data block at a number of different points intime (e.g., t0, t1, t2). The amount of valid data can be measured aseither a raw number or as a fraction or percentage of the total data onthe data block (i.e., the amount of valid data plus the amount ofinvalid data). From these values over time, garbage collection component113 can determine the rate of change. In one embodiment, garbagecollection component 113 can calculate a slope representing the rate ofchange and/or can predict, based on the past values, a rate of changefor the amount of valid data on the first data block in the future. Forexample, garbage collection component 113 can apply a curve fittingalgorithm (e.g., interpolation, smoothing, regression analysis,extrapolation, algebraic, geometric, etc.) to calculate the slope and/ormachine learning (e.g., instance-based, regression analysis,regularization, classifiers, etc.) to make the predictions. In oneembodiment, the high threshold may be a slope of 5%, for example,although the threshold is configurable, in other embodiments, based onan amount available storage space on the memory component 112A. Forexample, if a large amount of storage space is available, garbagecollection component 113 can afford to be more selective in identifyingcandidate blocks for garbage collection and thus, can reduce the highthreshold. If, however, a lesser amount of storage space is available onmemory component 112A, the garbage collection component 113 can be lessselective and increase the high threshold.

If the rate of change is above the high threshold, at operation 230, theprocessing device prevents the first data block from being identified asa candidate for garbage selection on the memory component. If the amountof valid data on the first data block is trending downward (i.e., therate of decrease in the amount of valid data is constant or at least hasnot leveled off) as illustrated by line 310 in FIG. 3A, garbagecollection component 113 can wait to garbage collect the first blockuntil later. Given the trend, the first data block will likely have evenless valid data in the future, leading to lower utilization ofresources, including fewer program/erase (P/E) cycles and improvedendurance for the memory component 112A.

If the rate of change is below the high threshold, at operation 260, theprocessing device determines whether the rate of change satisfies afourth threshold criterion (i.e., is below a low threshold). In oneembodiment, the low threshold may be a slope of 1% or 0.1%, for example,although, as described above, the threshold is configurable. The lowthreshold represents a saturation point at which it is expected that theamount of valid data on the data block will not decrease any further. Ifthe calculated slope has leveled off and has been consistent for aperiod of time (i.e., is saturated), then the first data block can be agood current candidate for garbage collection since further benefits areunlikely to be realized.

If the rate of change is above the low threshold, at operation 270, theprocessing device identifies the first data block as a candidate forgarbage collection on the memory component 112A. FIG. 3B illustrates aline 320 where the slope is less than the high threshold, but greaterthan the low threshold and thus, still meaningful. The data blockrepresented by line 320 has not yet reached saturation, but still may bea candidate for garbage collection. In one embodiment, garbagecollection component 113 adds an indication of the first data block to agarbage collection candidate list in local memory 119. The garbagecollection candidate list may be a ranked list where the data blocks arestored based on an associated priority level. In one embodiment, thepriority level is based on the actual rate of change of the amount ofvalid data on each data block, with the blocks having the lowest rate ofchange being given the highest priority, and thus being selected firstfor garbage collection. Accordingly, a data block for which the rate ofchange is less than the high threshold, but greater than the lowthreshold, would have a lower priority than another data block for whichthe rate of change is less than the low threshold.

If the rate of change is below the low threshold, at operation 280, theprocessing device identifies the first data block as a candidate forgarbage collection on the memory component 112A. FIG. 3C illustrates aline 330 where the slope is less than low threshold. The data blockrepresented by line 320 has reached saturation, and is thus an excellentcandidate for garbage collection. In one embodiment, garbage collectioncomponent 113 adds an indication of the first data block to a garbagecollection candidate list in local memory 119. Since the data block hasa rate of change that is less than the high threshold, it would have ahigher priority than another data block for which the rate of change ishigher. In other embodiments, there may be any number of intermediatethresholds between the high and low thresholds, all of which can beconfigured or otherwise adjusted to suit any particular implementation.As indicated in FIG. 3C, the amount of valid data on the first datablock (e.g., approximately 10%) may be higher than the amount of validdata on other data blocks which are not currently selected as candidatesfor garbage collection. Those other data blocks may have decreasingamounts of valid data such that they may have even less valid data inthe future, leading to lower utilization of resources for the garbagecollection process.

FIG. 4 is a flow diagram of an example method to reclaim space in amemory component in response to a write request in accordance with someembodiments of the present disclosure. The method 400 can be performedby processing logic that can include hardware (e.g., processing device,circuitry, dedicated logic, programmable logic, microcode, hardware of adevice, integrated circuit, etc.), software (e.g., instructions run orexecuted on a processing device), or a combination thereof. In someembodiments, the method 400 is performed by the garbage collectioncomponent 113 of FIG. 1. Although shown in a particular sequence ororder, unless otherwise specified, the order of the processes can bemodified. Thus, the illustrated embodiments should be understood only asexamples, and the illustrated processes can be performed in a differentorder, and some processes can be performed in parallel. Additionally,one or more processes can be omitted in various embodiments. Thus, notall processes are required in every embodiment. Other process flows arepossible.

At operation 410, the processing device receives a request to writefirst data to a memory component 112A. In one embodiment, controller 115receives the request from host system 120 or from some other componentconnected to memory sub-system 110. The write request may include thefirst data to be written and an indication of the memory component 112Ato which the first data is to be written.

At operation 420, the processing device determines whether the memorycomponent 112A has an amount of available storage space to accept thefirst data. In one embodiment, controller 115 maintains records of theamount of available space (i.e., the capacity) on each of memorycomponents 112A to 112N. These records can be stored in local memory119. In response to receiving the write request, controller 115 maydetermine a size of the write request (i.e., a size of the first data tobe written to memory component 112A) and compare that size to an amountof available storage space on the memory component 112A. If the size ofthe first data is larger than the amount of available storage space,then controller 115 determines that memory component 112A does not havean amount of available storage space to accept the first data. If thememory component does have available space, at operation 460, theprocessing device writes the first data to a first data block on thememory component 112A.

If the memory component does not have the amount of available storagespace, at operation 430, the processing device identifies a first datablock of a plurality of data blocks on the memory component 112A toerase based on a rate of change of an amount of valid data on the firstdata block. In one embodiment, the rate of change of the amount of validdata of the identified data block is below a threshold. As describedabove with respect to FIG. 2, in one embodiment, garbage collectioncomponent 113 determines whether a first data block of a plurality ofdata blocks on one of memory components 112A to 112N is among a firstthreshold number of the plurality of data blocks having a lower amountof valid data than a remainder of the plurality of data blocks.Responsive to the first data block being among the first thresholdnumber, garbage collection component 113 determines whether the firstdata block is among a second threshold number of the plurality of datablocks having been written to more recently than the remainder of theplurality of data blocks. Responsive to the first data block being amongthe second threshold number, garbage collection component 113 determineswhether a rate of change of an amount of valid data on the first datablock is below a third threshold. Responsive to the rate of change beingbelow the third threshold, garbage collection component 113 identifiesthe first data block as a candidate for garbage collection on the memorycomponent.

At operation 440, the processing device moves the valid data on thefirst data block from the first data block to a second data block on thememory component 112A or on another memory component 112N of the memorysub-system 110 and at operation 450, the processing device erases theinvalid data on the first data block. In one embodiment, garbagecollection component 113 reads data stored on the first data block andwrites that data to another data block. Once the data has been writtento the other data block, the remaining invalid data stored in the firstdata block is erased and the initial data block is available to beprogrammed with new data. Depending on the embodiment, the data isrelocated to another data block of the same memory component 112A or toa different memory component of the memory sub-system 110. At operation460, the processing device writes the first data to the newly erasedfirst data block.

FIG. 5 illustrates an example machine of a computer system 500 withinwhich a set of instructions, for causing the machine to perform any oneor more of the methodologies discussed herein, can be executed. In someembodiments, the computer system 500 can correspond to a host system(e.g., the host system 120 of FIG. 1) that includes, is coupled to, orutilizes a memory sub-system (e.g., the memory sub-system 110 of FIG. 1)or can be used to perform the operations of a controller (e.g., toexecute an operating system to perform operations corresponding to thegarbage collection component 113 of FIG. 1). In alternative embodiments,the machine can be connected (e.g., networked) to other machines in aLAN, an intranet, an extranet, and/or the Internet. The machine canoperate in the capacity of a server or a client machine in client-servernetwork environment, as a peer machine in a peer-to-peer (ordistributed) network environment, or as a server or a client machine ina cloud computing infrastructure or environment.

The machine can be a personal computer (PC), a tablet PC, a set-top box(STB), a Personal Digital Assistant (PDA), a cellular telephone, a webappliance, a server, a network router, a switch or bridge, or anymachine capable of executing a set of instructions (sequential orotherwise) that specify actions to be taken by that machine. Further,while a single machine is illustrated, the term “machine” shall also betaken to include any collection of machines that individually or jointlyexecute a set (or multiple sets) of instructions to perform any one ormore of the methodologies discussed herein.

The example computer system 500 includes a processing device 502, a mainmemory 504 (e.g., read-only memory (ROM), flash memory, dynamic randomaccess memory (DRAM) such as synchronous DRAM (SDRAM) or Rambus DRAM(RDRAM), etc.), a static memory 506 (e.g., flash memory, static randomaccess memory (SRAM), etc.), and a data storage system 518, whichcommunicate with each other via a bus 530.

Processing device 502 represents one or more general-purpose processingdevices such as a microprocessor, a central processing unit, or thelike. More particularly, the processing device can be a complexinstruction set computing (CISC) microprocessor, reduced instruction setcomputing (RISC) microprocessor, very long instruction word (VLIW)microprocessor, or a processor implementing other instruction sets, orprocessors implementing a combination of instruction sets. Processingdevice 502 can also be one or more special-purpose processing devicessuch as an application specific integrated circuit (ASIC), a fieldprogrammable gate array (FPGA), a digital signal processor (DSP),network processor, or the like. The processing device 502 is configuredto execute instructions 526 for performing the operations and stepsdiscussed herein. The computer system 500 can further include a networkinterface device 508 to communicate over the network 520.

The data storage system 518 can include a machine-readable storagemedium 524 (also known as a computer-readable medium) on which is storedone or more sets of instructions 526 or software embodying any one ormore of the methodologies or functions described herein. Theinstructions 526 can also reside, completely or at least partially,within the main memory 504 and/or within the processing device 502during execution thereof by the computer system 500, the main memory 504and the processing device 502 also constituting machine-readable storagemedia. The machine-readable storage medium 524, data storage system 518,and/or main memory 504 can correspond to the memory sub-system 110 ofFIG. 1.

In one embodiment, the instructions 526 include instructions toimplement functionality corresponding to the garbage collectioncomponent 113 of FIG. 1). While the machine-readable storage medium 524is shown in an example embodiment to be a single medium, the term“machine-readable storage medium” should be taken to include a singlemedium or multiple media that store the one or more sets ofinstructions. The term “machine-readable storage medium” shall also betaken to include any medium that is capable of storing or encoding a setof instructions for execution by the machine and that cause the machineto perform any one or more of the methodologies of the presentdisclosure. The term “machine-readable storage medium” shall accordinglybe taken to include, but not be limited to, solid-state memories,optical media, and magnetic media.

Some portions of the preceding detailed descriptions have been presentedin terms of algorithms and symbolic representations of operations ondata bits within a computer memory. These algorithmic descriptions andrepresentations are the ways used by those skilled in the dataprocessing arts to most effectively convey the substance of their workto others skilled in the art. An algorithm is here, and generally,conceived to be a self-consistent sequence of operations leading to adesired result. The operations are those requiring physicalmanipulations of physical quantities. Usually, though not necessarily,these quantities take the form of electrical or magnetic signals capableof being stored, combined, compared, and otherwise manipulated. It hasproven convenient at times, principally for reasons of common usage, torefer to these signals as bits, values, elements, symbols, characters,terms, numbers, or the like.

It should be borne in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. The presentdisclosure can refer to the action and processes of a computer system,or similar electronic computing device, that manipulates and transformsdata represented as physical (electronic) quantities within the computersystem's registers and memories into other data similarly represented asphysical quantities within the computer system memories or registers orother such information storage systems.

The present disclosure also relates to an apparatus for performing theoperations herein. This apparatus can be specially constructed for theintended purposes, or it can include a general purpose computerselectively activated or reconfigured by a computer program stored inthe computer. Such a computer program can be stored in a computerreadable storage medium, such as, but not limited to, any type of diskincluding floppy disks, optical disks, CD-ROMs, and magnetic-opticaldisks, read-only memories (ROMs), random access memories (RAMs), EPROMs,EEPROMs, magnetic or optical cards, or any type of media suitable forstoring electronic instructions, each coupled to a computer system bus.

The algorithms and displays presented herein are not inherently relatedto any particular computer or other apparatus. Various general purposesystems can be used with programs in accordance with the teachingsherein, or it can prove convenient to construct a more specializedapparatus to perform the method. The structure for a variety of thesesystems will appear as set forth in the description below. In addition,the present disclosure is not described with reference to any particularprogramming language. It will be appreciated that a variety ofprogramming languages can be used to implement the teachings of thedisclosure as described herein.

The present disclosure can be provided as a computer program product, orsoftware, that can include a machine-readable medium having storedthereon instructions, which can be used to program a computer system (orother electronic devices) to perform a process according to the presentdisclosure. A machine-readable medium includes any mechanism for storinginformation in a form readable by a machine (e.g., a computer). In someembodiments, a machine-readable (e.g., computer-readable) mediumincludes a machine (e.g., a computer) readable storage medium such as aread only memory (“ROM”), random access memory (“RAM”), magnetic diskstorage media, optical storage media, flash memory components, etc.

In the foregoing specification, embodiments of the disclosure have beendescribed with reference to specific example embodiments thereof. Itwill be evident that various modifications can be made thereto withoutdeparting from the broader spirit and scope of embodiments of thedisclosure as set forth in the following claims. The specification anddrawings are, accordingly, to be regarded in an illustrative senserather than a restrictive sense.

What is claimed is:
 1. A system comprising: a memory device; and aprocessing device, operatively coupled with the memory device, toperform operations comprising: determining a rate at which an amount ofvalid data is decreasing on a first block of the memory device;determining whether the rate at which the amount of valid data isdecreasing on the first block satisfies a threshold criterion; andresponsive to the rate at which the amount of valid data is decreasingon the first block satisfying the threshold criterion, performing amedia management operation on the first block of the memory device. 2.The system of claim 1, wherein performing the media management operationcomprises performing a garbage collection operation.
 3. The system ofclaim 1, wherein the processing device to perform further operationscomprising: responsive to the rate at which the amount of valid data isdecreasing on the first block not satisfying the threshold criterion,preventing the media management operation from being performed on thefirst block of the memory device.
 4. The system of claim 1, wherein thethreshold criterion is configurable based on an amount available storagespace on the memory device.
 5. The system of claim 1, wherein theprocessing device to perform further operations comprising: determiningwhether the first block is among a first number of the plurality ofblocks having a lower amount of valid data than a remainder of theplurality of blocks.
 6. The system of claim 5, wherein the processingdevice to perform further operations comprising: responsive to the firstblock being among the first number of the plurality of blocks,determining whether the first block is among a second number of theplurality of blocks having been written to more recently than theremainder of the plurality of blocks.
 7. The system of claim 1, whereinthe processing device to perform further operations comprising:determining that the rate at which the amount of valid data isdecreasing on the first block does not satisfy the threshold criterionand satisfies a different threshold criterion; and assigning a lowerpriority associated with the media management operation to the firstblock than to a second block, wherein a rate at which an amount of validdata is decreasing on the second block satisfies the thresholdcriterion.
 8. A method comprising: receiving a request to write firstdata to a memory device; determining that the memory device does nothave an amount available storage space to accept the first data;identifying a first block of a plurality of blocks on the memory deviceto erase based on a rate at which an amount of valid data is decreasingon the first block, wherein the rate at which the amount of valid datais decreasing on the first block satisfies a first threshold criterion;moving the valid data on the first block from the first block to asecond block on the memory device; erasing invalid data on the firstblock; and writing the first data to the first block.
 9. The method ofclaim 8, further comprising: identifying an amount of valid data on eachof the plurality of blocks; and sorting the plurality of blocks based onthe amount of valid data on each of the plurality of blocks.
 10. Themethod of claim 9, further comprising: identifying a first subset of theplurality of blocks, wherein the amount of valid data on each of thefirst subset of the plurality of blocks is less than the amount of validdata on each of the plurality of blocks not in the first subset.
 11. Themethod of claim 10, further comprising: identifying a second subset ofthe plurality of blocks, wherein a write operation was performed on eachof the second subset of the plurality of blocks more recently than oneach of the plurality of blocks not in the second subset.
 12. The methodof claim 11, wherein the first block is in both the first subset and thesecond subset.
 13. The method of claim 8, wherein the first thresholdcriterion is configurable based on the amount available storage space onthe memory device.
 14. A non-transitory computer-readable storage mediumcomprising instructions that, when executed by a processing device,cause the processing device to perform operations comprising:determining a rate at which an amount of valid data is decreasing on afirst block of the memory device; determining whether the rate at whichthe amount of valid data is decreasing on the first block satisfies athreshold criterion; and responsive to the rate at which the amount ofvalid data is decreasing on the first block satisfying the thresholdcriterion, performing a media management operation on the first block ofthe memory device.
 15. The non-transitory computer-readable storagemedium of claim 14, wherein performing the media management operationcomprises performing a garbage collection operation.
 16. Thenon-transitory computer-readable storage medium of claim 14, wherein theinstructions cause the processing device to perform further operationscomprising: responsive to the rate at which the amount of valid data isdecreasing on the first block not satisfying the threshold criterion,preventing the media management operation from being performed on thefirst block of the memory device.
 17. The non-transitorycomputer-readable storage medium of claim 14, wherein the thresholdcriterion is configurable based on an amount available storage space onthe memory device.
 18. The non-transitory computer-readable storagemedium of claim 14, wherein the instructions cause the processing deviceto perform further operations comprising: determining whether the firstblock is among a first number of the plurality of blocks having a loweramount of valid data than a remainder of the plurality of blocks. 19.The non-transitory computer-readable storage medium of claim 18, whereinthe instructions cause the processing device to perform furtheroperations comprising: responsive to the first block being among thefirst number of the plurality of blocks, determining whether the firstblock is among a second number of the plurality of blocks having beenwritten to more recently than the remainder of the plurality of blocks.20. The non-transitory computer-readable storage medium of claim 14,wherein the instructions cause the processing device to perform furtheroperations comprising: determining that the rate at which the amount ofvalid data is decreasing on the first block does not satisfy thethreshold criterion and satisfies a different threshold criterion; andassigning a lower priority associated with the media managementoperation to the first block than to a second block, wherein a rate atwhich an amount of valid data is decreasing on the second blocksatisfies the threshold criterion.